package view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.ImageView;

public class CircleBgImageView extends ImageView {
    Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);

    public CircleBgImageView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public CircleBgImageView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        paint.setColor(Color.argb(30, 0, 0, 0));
    }

    @Override
    protected void onDraw(Canvas canvas) {
        canvas.drawCircle(getMeasuredWidth() / 2, getMeasuredHeight() / 2, getMeasuredHeight() / 2, paint);
        super.onDraw(canvas);
    }

}
